package com.aid.winter.mapper;

import com.aid.winter.entity.AidClothesRegister;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;

@Mapper
public interface AidClothesRegisterMapper {
    
    /**
     * 插入登记
     */
    int insert(AidClothesRegister register);
    
    /**
     * 根据ID查询登记
     */
    AidClothesRegister selectById(@Param("id") Long id);
    
    /**
     * 根据申请ID查询登记
     */
    AidClothesRegister selectByApplicationId(@Param("applicationId") Long applicationId);
    
    /**
     * 更新登记
     */
    int updateById(AidClothesRegister register);
    
    /**
     * 查询登记列表
     */
    List<AidClothesRegister> selectList(@Param("styleId") Long styleId,
                                       @Param("studentId") Long studentId,
                                       @Param("offset") Integer offset,
                                       @Param("limit") Integer limit);
    
    /**
     * 查询总数
     */
    long selectCount(@Param("styleId") Long styleId,
                    @Param("studentId") Long studentId);
    
    /**
     * 统计各尺码数量
     */
    List<Map<String, Object>> selectSizeStatistics(@Param("styleId") Long styleId,
                                                  @Param("collegeId") Long collegeId);
}